package com.etrans.baf.analyse.util;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.http.HttpServletResponse;

import com.alibaba.fastjson.JSON;

public class CommonUtil {
	public static void ajaxResultJson(HttpServletResponse response, Object object) {
		response.setContentType( "text/html; charset=utf-8");
		PrintWriter out;
		try {
			out = response.getWriter();
			StringBuffer sb = new StringBuffer();
			sb.append(JSON.toJSON(object));
			out.print(sb.toString());
			out.flush();
			out.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
